package org.easyexcel.MydoMian;

import org.openjdk.jcstress.annotations.*;
import org.openjdk.jcstress.annotations.JCStressTest;
import org.openjdk.jcstress.infra.results.I_Result;
/**
 * @author DPF
 */
@JCStressTest
@Outcome(id = {"0"},expect = Expect.ACCEPTABLE_INTERESTING , desc = "wrong result")
@Outcome(id = {"-1","5"},expect = Expect.ACCEPTABLE,desc = "normal result")
@State
public class ConcurrencyTest {
    public ConcurrencyTest(){};
    private boolean flag;
    private int x;

    @Actor
    public void actor1(I_Result r){
        if(flag){
            r.r1 = x;
        }else{
            r.r1 = -1;
        }
    }
    @Actor
    public void actor2(I_Result r){
        this.x = 5;
        flag = true;
    }
}


